import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export const listPage = (query) => request({
    url: baseUrl + '/admin/dict/page',
    method: 'get',
    params: query
});

export const saveDict = (data) => request({
    url: baseUrl + '/admin/dict/save',
    method: 'post',
    data: data
});

export const getByType = (type) => request({
    url: baseUrl + '/admin/dict/type/' + type,
    method: 'get',
});

export const updateDict = (data) => request({
    url: baseUrl + '/admin/dict/update',
    method: 'put',
    data: data
});

export const deleteDict = (id) => request({
    url: baseUrl + '/admin/dict/delete/' + id,
    method: 'delete',
});
